package com.example.a2205douyin.baseMVVM.view;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.ViewModelProvider;

import com.example.a2205douyin.baseMVVM.viewmodel.BaseViewModel;
import com.jaeger.library.StatusBarUtil;

/**
 * 这个baseViewActivity不需要执行后台请求，经常使用位置为主页--里面去嵌套fragment的时候
 * @param <VDB>
 */
public abstract class BaseViewActivity<VDB extends ViewDataBinding> extends AppCompatActivity {
    protected VDB binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,getLayout());
        initView();
        initData();
        //沉浸式状态栏
        StatusBarUtil.setTranslucentForImageView(this,0,null);
    }

    protected abstract void initData();

    protected abstract void initView();

    protected abstract int getLayout();

}
